<extend name="Base:base" />
<block name="title">{$title}</block>
<block name="content">

    <div class="cf">
        <a class="btn" href="{:U('addUser')}">新 增111</a>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="name" class="search-input" value="{:I('name')}" placeholder="请输入菜单名称">
                <a class="sch-btn" href="javascript:;" id="search" url="__SELF__"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>
    <div class="data-table table-striped">
        <form class="ids">
            <table>
                <thead>
                    <tr>
                        <th>用户ID</th>
                        <th>用户名</th>
                        <th>登陆次数</th>
                        <th>登陆时间</th>
                        <th>是否锁定</th>
                        <th>用户角色</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <foreach name="list" item="user">
                    <tr>
                        <td>[{$user.id}]</td>
                        <td>{$user.name}</td>
                        <td>{$user.logins}</td>
                        <td>{$user.last_login|date='y-m-d H:i',###}</td>
                        <td>
                    <if condition="$user.is_active eq 1">[锁定]
                        <else />[启用]
                    </if>
                    </td>
                    <td>
                        <ul>
                            <if condition="$user['name'] eq C('RBAC_SUPERADMIN')">
                                系统管理员
                                <else />         
                                <foreach name="user.roles" item="role">
                                    <li>
                                       {$role.remark}
                                    </li>
                                </foreach>
                            </if>
                        </ul>
                    </td>
                    <td>
                          <if condition="$user.is_active eq 1"> <a href="{:U('Admin/Rbac/setActive',array('id'=>$user['id'],'value'=>0))}">启用|</a>
                              <else /> <a href="{:U('Admin/Rbac/setActive',array('id'=>$user['id'],'value'=>1))}">锁定|</a></if>
                        <a href="{:U('Admin/Rbac/editUser',array('id'=>$user['id']))}">修改</a>|
                        <a onclick="return confirm('是否确定要删除?');" href="{:U('Admin/Rbac/deleteUser',array('id'=>$user['id']))}">删除</a>
                    </td>
                    </tr>
                </foreach>
            </table>
            <div class="digg">{$page}</div>
    </div>
</block>
